package com.aat.dxfy.aaa.app;

import java.math.BigDecimal;
import java.util.Map;

public class HouseMoney {
	public static void main(String[] args) {
		double all=4500*130;
		System.out.println(all);
		double invest = all*0.8; // 本金
		int month = 120;
		double yearRate = 0.049; // 年利率
		
		
		double perMonthPrincipalInterest = AverageCapitalPlusInterestUtils.getPerMonthPrincipalInterest(invest,
				yearRate, month);
		System.out.println("等额本息---每月还款本息：" + perMonthPrincipalInterest);
		Map<Integer, BigDecimal> mapInterest = AverageCapitalPlusInterestUtils.getPerMonthInterest(invest, yearRate,
				month);
		System.out.println("等额本息---每月还款利息：" + mapInterest);
		Map<Integer, BigDecimal> mapPrincipal = AverageCapitalPlusInterestUtils.getPerMonthPrincipal(invest, yearRate,
				month);
		System.out.println("等额本息---每月还款本金：" + mapPrincipal);
		double count = AverageCapitalPlusInterestUtils.getInterestCount(invest, yearRate, month);
		System.out.println("等额本息---总利息：" + count);
		//double principalInterestCount = AverageCapitalPlusInterestUtils.getPrincipalInterestCount(invest, yearRate,month);
		//System.out.println("等额本息---应还本息总和：" + principalInterestCount);
		System.out.println();

		Map<Integer, Double> getPerMonthPrincipalInterest = AverageCapitalUtils.getPerMonthPrincipalInterest(invest, yearRate, month);
		System.out.println("等额本金---每月本息：" + getPerMonthPrincipalInterest);
		double benjin = AverageCapitalUtils.getPerMonthPrincipal(invest, month);
		System.out.println("等额本金---每月本金:" + benjin);
		Map<Integer, Double> mapInterest2 = AverageCapitalUtils.getPerMonthInterest(invest, yearRate, month);
		System.out.println("等额本金---每月利息:" + mapInterest2);

		double count2 = AverageCapitalUtils.getInterestCount(invest, yearRate, month);
		System.out.println("等额本金---总利息：" + count2);
		
		System.out.println();
		System.out.println(count-count2);

	}
}
